import React from 'react';
import ThemeContext from '../theme-context';

const ThemedBar=() => {
  return (
    <ThemeContext.Consumer>
      {
        theme => {
          console.log(theme);
          return (
            <div className="alert" style={{color: theme.color, backgroundColor: theme.bgcolor}}>
              <p>样式区域</p>
              <button className={theme.classnames}>样式按钮</button>
            </div>
          );
        }
      }
    </ThemeContext.Consumer>
  );
};

export default ThemedBar;
